using System.Collections.Generic;
using Castle.ActiveRecord;
using MyMovieCollection.DATA.DataAccess.Interfaces;
using MyMovieCollection.DATA.Models;

namespace MyMovieCollection.DATA.DataAccess.AR
{
    public class MovieTypeDao : IMovieTypeDao
    {
        public List<MovieType> GetAll()
        {
            return new List<MovieType>(ActiveRecordBase<MovieType>.FindAll());
        }
        public void AddMovieType(MovieType movieType)
        {
            if (movieType != null)
                movieType.CreateAndFlush();
        }
        public MovieType GetById(int id )
        {
            return ActiveRecordBase<MovieType>.Find(id);
        }
    }
}